package cn.wit.summit.chwan.widgets;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import cn.wit.summit.chwan.R;
import okhttp3.FormBody;

/**
 * Created by yangg on 2018/4/27.
 */

public class RedDataDialog extends AlertDialog {

    TextView tv_monry, tv_neng, tv_yao_money;
    ImageView iv_close;
    RelativeLayout rl_qiandao, rl_yaoqing;
    Button btn;


    public RedDataDialog(Context context) {
        super(context);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Window dialogWindow = getWindow();
        dialogWindow.setBackgroundDrawableResource(android.R.color.transparent);
        dialogWindow.setGravity(Gravity.CENTER);
        setContentView(R.layout.reddatadialog);
        tv_monry = findViewById(R.id.tv_money);
        iv_close = findViewById(R.id.close_reddate);
//        ll_tixian = findViewById(R.id.ll_tixian);
        rl_qiandao = findViewById(R.id.rl_qiandao);
        rl_yaoqing = findViewById(R.id.rl_yaoqing);
        tv_neng = findViewById(R.id.tv_neng);
        tv_yao_money = findViewById(R.id.tv_yao_monry);
        btn=findViewById(R.id.but_t);
    }


    public void onClickClose(View.OnClickListener listener) {
        iv_close.setOnClickListener(listener);
    }

    public void onClickTiXian(View.OnClickListener listener) {
//        ll_tixian.setOnClickListener(listener);
        btn.setOnClickListener(listener);
    }

    public void onClickQian(View.OnClickListener listener) {
        rl_qiandao.setOnClickListener(listener);
    }

    public void onClickYao(View.OnClickListener listener) {
        rl_yaoqing.setOnClickListener(listener);
    }

    public void setValue(String monry, String neng, String yaoMoney) {
        tv_monry.setText(monry);
        tv_neng.setText(neng);
        tv_yao_money.setText(yaoMoney);
    }
}
